About ASC Ⅱ code in php: this is a detailed page of ASC Ⅱ code in php. it introduces php, related knowledge, skills, experience, and some php source code.
Class = 'pingjiaf' frameborder = '0' src = 'http: // biancheng.dnbc?info/pingjia.php? Id = 3366
PHP gets the first letter of Chinese pinyin
Copy CodeThe code is as follows:
function Getinitial ($STR)
{
$asc =ord (substr ($str, 0, 1));
if ($ASC {
if ($asc >=48 && $asc Return ' 1 '; Digital
}elseif ($asc >=65 && $asc return Chr ($ASC);
Php is used to obtain the first letter of Chinese characters and pinyin. The code for php to copy the first letter of Chinese character Pinyin is as follows :? Phpfunctiongetinitial ($ str) {$ ascord (substr ($ str, 0, 1); if ($ asc160) non-Chinese {
PHP obtains the first letter of Chinese pinyin
CopyCode The Code is as follows: Function getinitial ($ Str)
{
$ ASC = ord (substr ($ STR, 0, 1 ));
If ($ ASC {
If ($ ASC >=48 & $ ASC Return '1'; // number
} Elseif ($ ASC >=65 & $ ASC Return CHR ($
PHP gets the first letter of Chinese pinyin
Copy Code code as follows:
function Getinitial ($STR)
{
$asc =ord (substr ($str, 0, 1));
if ($ASC {
if ($asc >=48 && $asc Return ' 1 '; Digital
}elseif ($asc >=65 && $asc return Chr ($ASC);
Php code for batch obtaining the first letter (Chinese characters, numbers, and English letters)
$ Mysql_server_name = '192. 0.0.1 '; // change it to your mysql database server.
$ Mysql_username = 'user';
To get the first letter of the method there are many, this we generally want to divide the Chinese characters and then converted to pinyin, and then use SUBSTR to take the first letter, below I found online two instances, different people together
Example 1The main functions are: clear functions, easy to modify, maintain, and expand; English strings: unchanged return (including numbers); Chinese Strings: return the first character of pinyin; Chinese-English string: returns the first and
PHP get Pinyin First letter
After the program runs, it is found that some text in the string cannot be converted. If you enter these words individually, you can read and remove the phonetic opening letters directly by converting them.
It doesn't
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.